All Functions Used So Far, Week 4

ggsave

{ggplot2}

Saves the last ggplot or a specified ggplot object to a file

ungroup

{dplyr}

Resolve grouping created with “group_by”

ggplot

{GGPLOT2}

Create a ggplot graph

scale_y_continuous

{GGPLOT2}

Customise continuous y axis

filter

{dplyr}

Filter out rows of a data frame according to logical vector

theme

{GGPLOT2}

Set theme for GGPLOT2

mean

{base}

Get mean of a vector

prop.test

{stats}

Test of Equal or Given Proportions

slice_sample

{dplyr}

Randomly selects rows from a data frame or tibble.

geom_smooth

{GGPLOT2}

Generates a smoothed conditional means curve / line

min

{base}

Get minimum of a vector

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

mutate

{dplyr}

Modify/create a column in a data frame

lm

{base}

Fit a linear model

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

with

{base}

evaluate expression in the context of a data frame

c

{base}

Combine values/vectors into a vector

set.seed

{base}

Initialise a pseudorandom number generator.

round

{base}

Rounds numbers

ordered

{dplyr}

Create an ordered factor

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

summary

{base}

Obtain summary statistics or detailed regression output

element_blank

{GGPLOT2}

This theme element draws nothing, and assigns no space

setwd

{base}

Set Working Directory

colnames

{base}

Retrieve column names of a data frame

library

{base}

Load an R package

element_text

{GGPLOT2}

Customise text in GGPLOT2

nrow

{base}

Get number of rows of a data frame

median

{stats}

Get median of a vector

cut

{base}

Convert Numeric to Factor

geom_point

{GGPLOT2}

Generates a scatter plot

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

rename

{dplyr}

Renames columns in a data frame or tibble.

is.na

{base}

Check if a value is NA/elements of vector are NA

t.test

{stats}

Performs one and two sample t-tests on vectors of data.

select

{dplyr}

Select columns from a tibble/data frame

chisq.test

{stats}

Chi-Squared test (e.g. for cross-tabulations)

element_line

{GGPLOT2}

Customise line appearance

read_excel

{readxl}

Read an Excel file

labs

{GGPLOT2}

Customise labels in GGPLOT2

leveneTest

{car}

Computes Levene’s test for homogeneity of variance across groups.

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

The end!